const AutoImport = require("unplugin-auto-import/webpack");
const Components = require("unplugin-vue-components/webpack");
const { ElementPlusResolver } = require("unplugin-vue-components/resolvers");

module.exports = {
  css: {
    loaderOptions: {
      css: {
        import: {
          filter: (url) => {
            if (url.includes("light.css") || url.includes("dark.css")) {
              return false;
            }
            return true;
          },
        },
      },
      // 给 less-loader 传递 Less.js 相关选项
      // less: {
      //   globalVars: {
      //     primary: "#fff",
      //   },
      // },
    },
  },
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
  },
};
